package com.fqgj.xjd.user.client.response;


import com.fqgj.xjd.user.client.enums.CreditAuthTypeEnum;
import com.fqgj.xjd.user.client.request.BankAuth;
import com.fqgj.xjd.user.client.request.UserBank;
import com.fqgj.xjd.user.client.request.ZmCredit;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/2/27
 * Time: 下午2:13
 */
public class CreditAuthResponse implements Serializable{

    private static final long serialVersionUID = -8624392290150809487L;
    private String userCode;

    private Integer authType;

    private ZmCredit zmCredit;

    private BankAuth bankAuth;

    private Boolean authorized = false;

    public CreditAuthResponse() {
    }

    public CreditAuthResponse(String userCode, CreditAuthTypeEnum authType, ZmCredit zmCredit) {
        this.userCode = userCode;
        this.authType = authType.getType();
        this.zmCredit = zmCredit;
    }

    public String getUserCode() {
        return userCode;
    }

    public CreditAuthResponse setUserCode(String userCode) {
        this.userCode = userCode;
        return this;
    }

    public Integer getAuthType() {
        return authType;
    }

    public CreditAuthResponse setAuthType(Integer authType) {
        this.authType = authType;
        return this;
    }

    public ZmCredit getZmCredit() {
        return zmCredit;
    }

    public CreditAuthResponse setZmCredit(ZmCredit zmCredit) {
        this.zmCredit = zmCredit;
        return this;
    }

    public Boolean getAuthorized() {
        return authorized;
    }

    public CreditAuthResponse setAuthorized(Boolean authorized) {
        this.authorized = authorized;
        return this;
    }

    private Boolean isAuthTypeExist(Integer authType) {
        CreditAuthTypeEnum[] creditAuthTypeEna = CreditAuthTypeEnum.values();
        for (CreditAuthTypeEnum creditAuthTypeEnum : creditAuthTypeEna) {
            if (creditAuthTypeEnum.getType() == authType) {
                return true;
            }
        }

        return false;
    }

    public BankAuth getBankAuth() {
        return bankAuth;
    }

    public void setBankAuth(BankAuth bankAuth) {
        this.bankAuth = bankAuth;
    }
}
